package com.wuneng.commonlibrary.util;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

/**
 * Created by x on 2017/1/5.
 */

public class ToastUtils {

    public static void showToast(Context context, String msg) {
        Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.BOTTOM, 0, 0);
        toast.show();
    }

    public static void showToast(Context context, String msg, int gravity){
        Toast toast = Toast.makeText(context, msg, Toast.LENGTH_SHORT);
        toast.setGravity(gravity, 0, 0);
        toast.show();
    }

    public static void showCustomTimeToast(Context context, String msg, int time){
        Toast toast = Toast.makeText(context,msg,time);
        toast.setGravity(Gravity.BOTTOM,0,0);
        toast.show();
    }


}
